package com.yzy.fly.exception;

import org.springframework.util.StringUtils;

public class EntityNoExistException extends RuntimeException {

    public EntityNoExistException(Class clazz, String val) {
        super(EntityNoExistException.generateMessage(clazz.getSimpleName(), val));
    }

    private static String generateMessage(String entity, String val) {
        return StringUtils.capitalize(entity)
                +  val + " not existed";
    }
}